/*  Copyright (C) 2008 Igor Maculan <n3wtron AT gmail.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef MAINWIN_H_
#define MAINWIN_H_

#include <QMainWindow>
#include <QSet>
#include <QProcess>
#include <QSettings>
#include "ui_MainWin.h"
#include "ui_About.h"
#include "DotEdit.h"
using namespace Ui;

class MainWin : public QMainWindow {
    Q_OBJECT
private:
    QString destType;
    MainWin_ui ui;
    About_ui uiAbout;
    QList<DotEdit*> dotEdits;
    DotEdit *actualEditor;
    void connectSignals();
    QString basicDirPath;
    void refreshBasicDirPath(QString);
    int zoom;
    void setCompilationState(int state);
    void readSettings();
    QSettings *setting;
    QString editItemString;
public:
    MainWin();
public slots:
    void newFile();
    void save();
    void saveAs();
    void open();
    bool closeFile();
    void compile();
    void view();
    void zoomIn();
    void zoomOut();
    void changeEditor(int);
    void refreshElements();
    void nextTab();
    void prevTab();
    void openSettingsWindow();
    void editActualElement();
    void endEditActualElement(QListWidgetItem *it);

private slots:
    void fileChange();
    void about();
    void changeDestType(int);
    void drawLine();
    void preamble();
    void openAddElementWindow();
    void openAssociateElementWindow();
    void addElementFromList(QListWidgetItem*);
    void deleteSelectedElement();
protected:
    void closeEvent(QCloseEvent *event);
};

#endif /*MAINWIN_H_*/
